package com.lee9213.demo.dao.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lee9213.core.annotation.Transactional;
import com.lee9213.demo.dao.IDemoDao;
import com.lee9213.demo.entity.DemoEntity;
import com.lee9213.demo.mapper.IDemoMapper;

/**
 * @author libo
 * @version 1.0
 * @date 2017/11/27 16:51
 */
@Transactional("jtaTransactionManager")
@Service
public class DemoDaoImpl implements IDemoDao {

    @Autowired
    protected IDemoMapper mapper;

    @Override
    public Long save(DemoEntity entity) {

        return mapper.save(entity);
    }

    @Override
    public Integer update(DemoEntity entity) {

        return mapper.update(entity);
    }

    @Override
    public List<DemoEntity> list() {
        return mapper.list();
    }
}
